<?php

namespace app\validate;


use share\validate\SceneValidate;

class UrlDomainValidate  extends SceneValidate{
    protected $rule = [
        'id' => 'require|integer',     
        'domain' => 'require|length:10,500',
        'name' => 'require|length:2,100',
        'type' => 'require|length:2,30',
        'site' => 'require|length:2,30',
        'sortIds' => 'require|array',
        'selector' => 'require|array',
        'includes'  => 'require|length:1,3000',
        'key' => 'require|length:2,100', 
        'account' => 'require|integer|>:0', 
        'appShare' => 'require|integer|>:0', 
        'burn' => 'require|integer|>:0', 
        'h5' => 'require|integer|>:0', 
        'oauth' => 'require|integer|>:0', 
        'oss' => 'require|integer|>:0', 
        '4g' => 'require|integer|>:0',
    ];

    protected $sceneRules = [
        // 'edit' => [
        //     'id' => 'require',
        //     'title' => 'length:1,100',
        //     'system' => 'length:2,64',
        //     'url' => 'length:4,1000',
        //     'vendor' => 'max:30', 
        //     'defaultPicture' => 'length:1,1000',          
        // ],
        'list' => [
            'domain' => 'length:2,500', 
            'name' =>  'length:2,100', 
            'type' =>  'length:2,30', 
        ],
    ];


    protected $scene = [      
        'set' => ['id','name','type','domain','site'],
        'del' => ['id'],
        'list' => ['domain','name','type'],
        'typeAllList' => ['type'],
        'setDefault' => ['id'],
        'setSort' => ['sortIds'],     
        'listSelector' => ['id'], 
        'saveSelector' => ['id','selector'],
        'saveSelectorItem' => ['id','type','includes'],
        'allocBySingle' => ['id','type','key','account','appShare','burn','h5','oauth','oss','4g'],
    ];
}